﻿<?php 

$beverages = array();
$beverages['coffee'][] = array(
	'image_src' => 'img/beverage/coffee1.png',
	'image_alt' => '',
	'name' => 'Coffee XX',
 );
$beverages['coffee'][] = array(
	'image_src' => 'img/beverage/coffee2.png',
	'image_alt' => '',
	'name' => 'Coffee YY',
 );
$beverages['coffee'][] = array(
	'image_src' => 'img/beverage/coffeeirish.png',
	'image_alt' => '',
	'name' => 'Coffee Irish',
 );
$beverages['coffee'][] = array(
	'image_src' => 'img/beverage/coffeemilk.png',
	'image_alt' => '',
	'name' => 'Coffee Milk',
 );

$beverages['tea'][] = array(
	'image_src' => 'img/beverage/tea1.png',
	'image_alt' => '',
	'name' => 'Tea 1'
);
$beverages['tea'][] = array(
	'image_src' => 'img/beverage/tea2.png',
	'image_alt' => '',
	'name' => 'Tea 2'
);
$beverages['tea'][] = array(
	'image_src' => 'img/beverage/tea3.png',
	'image_alt' => '',
	'name' => 'Tea 3'
);
$beverages['tea'][] = array(
	'image_src' => 'img/beverage/teaIced.png',
	'image_alt' => '',
	'name' => 'Tea Iced'
);
$beverages['chocolate'][] = array(
	'image_src' => 'img/beverage/chocolate1.png',
	'image_alt' => '',
	'name' => 'Chocolate 1'
);
$beverages['chocolate'][] = array(
	'image_src' => 'img/beverage/chocolate2.png',
	'image_alt' => '',
	'name' => 'Chocolate 2'
);

$beverages['soup'][] = array(
	'image_src' => 'img/beverage/soup.png',
	'image_alt' => '',
	'name' => 'Soup'
);

?>

<?php 

echo Utils::breadCrumbs(array(
							array('label' => 'My beverage list', 'link' => 'preferences'), 
							array('label'=> 'Add new beverage')
						));
?>

<h2>Add a new beverage to your list</h2>
<p>Use the menu below to choose the beverage type, the cup size and the amount of sugar (if necessary).</p>

<div id="menu">
	<ul>
		<li><a class="menu_item menu_selected" href="#coffee">Coffee</a></li>
		<li><a class="menu_item" href="#tea">Tea</a></li>
		<li><a class="menu_item" href="#chocolate">Chocolate</a></li>
		<li><a class="menu_item" href="#soup">Soup</a></li>
	</ul>

	<?php $id = 0; foreach($beverages as $type=>$beverage): ?>
	<div class="beverage <?php echo $type!='coffee'?'hide':''; ?>" id="<?php echo $type; ?>">
		<ul>
		<?php foreach($beverage as $b): ?>
			<li>
				<img src="<?php echo $b['image_src']; ?>" alt="<?php echo $b['image_alt']; ?>" />
				<div class="submenu">
						<form method="post" action="index.php?p=confirmadditem">
							<input type="hidden" name="info" value='<?php echo base64_encode(json_encode($b)); ?>' />
							<h2><?php echo $b['name']; ?></h2>
							<span>Choose the cup size</span>
							<select name="size">
								<option value="small" selected="selected">Small</option>
								<option value="medium" >Medium</option>
								<option value="large" >Large</option>
							</select>
						
							<?php if( $type != 'soup' ): ?>
							<span>Choose the amount of sugar</span>
							<select name="sugar">
								<option value="0" selected="selected">None</option>
								<option value="1" >Half</option>
								<option value="2" >One</option>
								<option value="3" >Two</option>
								<option value="4" >Four</option>
							</select>
							<?php endif; ?>
						
							<img src="img/icons/add.png" class="button_icon"/><input type="submit" value="Add" name="submit" class="button green"/>
							
						</form>
					</div>
			</li>
		<?php endforeach; ?>
		</ul>
	</div>
	<?php endforeach; ?>

</div>

